OPC-UA Embedded Server SDK  2.1.0
TCP/IP Functions

Functions

UA_Status_t UAServer_New_connection (uint64_t connection_id)
 
UA_Status_t UAServer_Connection_closed (uint64_t connection_id)
 
void UAServer_Callback_close_connection (uint64_t connection_id)
 
UA_Status_t UAServer_New_data_received (void *read_context, uint64_t connection_id)
 
bool_t UAServer_Callback_data_receive (void *application_context, uint64_t connection_id, uint8_t *buffer, uint32_t max_length_in_bytes, uint32_t *no_of_bytes_received)
 
UA_Status_t UAServer_Get_data_to_send (void *write_context, uint64_t connection_id)
 
bool_t UAServer_Callback_data_send (void *application_context, uint64_t connection_id, uint8_t *buffer, uint32_t no_of_bytes_to_send, uint32_t *no_of_bytes_sent)
 
UA_Status_t UAServer_Ready_to_receive (uint64_t connection_id, bool_t *result)
 

Detailed Description

Function Documentation

UA_Status_t UAServer_New_connection ( uint64_t  connection_id)

Informs the library that a new TCPIP connection has been made

Whenever a new TCPIP connection is made on the UA Server listening TCP PORT the host must call this function.

Parameters
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
Returns
The result of the operation.
UA_Status_t UAServer_Connection_closed ( uint64_t  connection_id)

Informs the library that a TCPIP connection has been terminated

Whenever a TCPIP connection is closed or aborted on the UA Server listening TCP PORT the host must call this function.

Parameters
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
Returns
The result of the operation.
void UAServer_Callback_close_connection ( uint64_t  connection_id)

Instructs the host application to close the socket

Whenever a TCP Binary connection is closed the library informs the host application to close the corresponding socket.

Parameters
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
UA_Status_t UAServer_New_data_received ( void *  read_context,
uint64_t  connection_id 
)

Informs the library that new data has been received

Whenever new data is received on a TCPIP connection the host must call this function. The library responds by calling UAServer_Callback_data_receive()

Parameters
[in]read_contextA pointer to an application specific data structure providing context to the pending read operation. The library will pass this pointer to UAServer_Receive_data_callback().
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
Returns
The result of the operation.
bool_t UAServer_Callback_data_receive ( void *  application_context,
uint64_t  connection_id,
uint8_t *  buffer,
uint32_t  max_length_in_bytes,
uint32_t *  no_of_bytes_received 
)

Read new data from TCP/IP stack

Whenever new data is received on an active TCPIP connection the library calls this function in response to UAServer_New_data_received()

Parameters
[in]application_contextA pointer to an application specific data structure providing context to the pending read operation. The host must pass this pointer to UAServer_New_data_received().
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
[in]bufferA pointer to the data buffer
[in]max_length_in_bytesThe maximum length of data to write into the buffer in bytes
[out]no_of_bytes_receivedThe number of bytes read into the buffer
Returns
More data is available to be read.
UA_Status_t UAServer_Get_data_to_send ( void *  write_context,
uint64_t  connection_id 
)

Get queued data to send from the library

When the library has data queued for transmission this function is called in order to send the queued data. The library responds by calling UAServer_Callback_data_send()

Parameters
[in]write_contextA pointer to an application specific data structure providing context to the pending read operation. The library will pass this pointer to UAServer_Send_data_callback().
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
Returns
The result of the operation.
bool_t UAServer_Callback_data_send ( void *  application_context,
uint64_t  connection_id,
uint8_t *  buffer,
uint32_t  no_of_bytes_to_send,
uint32_t *  no_of_bytes_sent 
)

Send new data to TCP/IP stack

The library calls this function in response to UAServer_Get_data_to_send()

Parameters
[in]application_contextA pointer to an application specific data structure providing context to the pending read operation. The host must pass this pointer to UAServer_Get_data_to_send().
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
[in]bufferPointer to the buffer containing the data to send
[in]no_of_bytes_to_sendThe length of data available to send in bytes
[out]no_of_bytes_sentThe number of data bytes sent. If this number equals the no_of_bytes_to_send the library may call the function again to send more data if available.
Returns
The TCP/IP stack can accept more data.
UA_Status_t UAServer_Ready_to_receive ( uint64_t  connection_id,
bool_t *  result 
)

Can the connection receive any more data at present

Parameters
[in]connection_idA unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used.
[out]resultTrue if the server can receive more data.
Returns
The result of the operation.